<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ROXR Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">ROXR Instruction<BR>
</h1>
<hr noshade></h1>
<BR>
        <span class="text"> The instruction ROXR (ROtate Left with eXtend) rotates a data register or a memory operand to the right. There are three ways to do this:<BR>
        <BR>
1. Rotate a data register to the right. Number of steps is a constant.<BR>
2. Rotate a data register to the right. Number of steps is stored in another data register. You can rotate 1-8 bits this way.<BR>
3. Rotate a word in the memory one bit to the right.<BR>
        <BR>
The rotation is done with an extra bit (i.e. a 9, 17 or 33 bit rotation). The least significant bit is rotated to the carry flag and to the extra flag. The bit at the extra flag will be rotated to the most significant bit in the operand.</span></P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="72%">
  <TBODY>
    <TR>
      <TD width="25%" align=middle class="text"><FONT color=#000080><BIG>-- -- &gt;</BIG></FONT></TD>
      <TD width="25%" align=middle class="text">OPERAND</TD>
      <TD width="25%" align=middle class="text">-- -- &gt;</TD>
      <TD width="25%" align=middle class="text">C</TD>
    </TR>
    <TR>
      <TD align=middle width="25%"></TD>
      <TD width="25%" align=middle class="text">&lt; --&nbsp; --</TD>
      <TD width="25%" align=middle class="text">X</TD>
      <TD width="25%" align=middle class="text">&lt;&nbsp; --&nbsp; --</TD>
    </TR>
  </TBODY>
</TABLE>
<P align=left class="text">ADDRESS METHODS: (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x.l (only when rotating a word in the memory)<BR>
          <BR>
  DATA LENGTH: Byte, word, longword<BR>
          <BR>
  When rotating in the memory, you can only use word.<BR>
</P>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="83%">
  <TBODY>
    <TR>
      <TD width="13%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
      <TD width="87%" class="text">X - The last bit that was rotated from the operand. Unaffected if rotation step was zero.</TD>
    </TR>
    <TR>
      <TD width="87%" class="text">N - S</TD>
    </TR>
    <TR>
      <TD width="87%" class="text">Z - S</TD>
    </TR>
    <TR>
      <TD width="87%" class="text">C - Same as X</TD>
    </TR>
    <TR>
      <TD width="87%"><span class="text">V - 0 </span>
          <P>&nbsp;</P></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="53%">
  <TBODY>
    <TR>
      <TD width="20%" rowSpan=3 class="text">SYNTAX:</TD>
      <TD width="80%" class="text">ROXL #&lt;steps&gt;,Dy</TD>
    </TR>
    <TR>
      <TD width="80%" class="text">ROXL Dx,Dy</TD>
    </TR>
    <TR>
      <TD width="80%" class="text">ROXL &lt;ea&gt;</TD>
    </TR>
  </TBODY>
</TABLE>
<P align=left><span class="text"><strong style="font-weight: 400">EXAMPLE CODE:</strong></span></P>
<P align=left class="sourcecode"><strong style="font-weight: 400">
<font face="Arial" size="2">&nbsp;&nbsp; ROXR.B&nbsp;&nbsp;&nbsp; #1,D0&nbsp;&nbsp;&nbsp; if 
D0.B contained 00001111, X = 1 it would now be 10000111 If X = 0 then 00000111</font></strong></P>
<P>&nbsp;</P>
<P align=left><span class="text">
  </span>
</P>
</body>
</html>